package com.ncepu.controller;

import com.ncepu.model.Cachestats;
import com.ncepu.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("/")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/user")
    public String getUser(@RequestParam int id) {
        return userService.getUserByIdWithCache(id);
    }

    @GetMapping("/user/cache/stats")
    public Cachestats getUserStats() {
        return userService.getUserStats();
    }
}
